Socket
Socket
Sign inDemoInstall

@scalecube/cluster-browser

Package Overview
Dependencies
Maintainers
7
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalecube/cluster-browser

[![Join the chat at https://gitter.im/scalecube-js/Lobby](https://badges.gitter.im/scalecube-js/Lobby.svg)](https://gitter.im/scalecube-js/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)


Version published
Weekly downloads
35
increased by400%
Maintainers
7
Weekly downloads
 
Created
Source

Join the chat at https://gitter.im/scalecube-js/Lobby

This is part of scalecube-js project, see more at https://github.com/scalecube/scalecube-js
Full documentation

Cluster-browser

This package provides a default cluster implementation for browser. it uses native browser message event for creating the distributed environment.

Basic Usage

import { joinCluster } from '@scalecube/cluster-browser';

const clusterOptions = {
  seedAddress,
  address,
  itemsToPublish: [],
};

const cluster = joinCluster(clusterOptions);

// calling `getCurrentMembersData()`, will resolve with the distributed environment's latest state.
cluster.getCurrentMembersData().then(console.log); 

// on subscribe to `listen$()`, we will start getting emits of the distributed environment's latest state.
cluster.listen$().subscribe(console.log); 


// on calling `destroy()`, we will remove our metadata from the distributed environment. 
// also, it stops the cluster from sharing/publishing metadata.
cluster.destroy().then(console.log); 

FAQs

Package last updated on 14 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc